IF( PASTIX_FOUND AND MURGE_FOUND )
  SET( pastixintf_SRC mod_pastixintf.f90 )
ELSE()
  SET( pastixintf_SRC mod_pastixintf_dummy.f90 )
ENDIF()

IF( MUMPS_FOUND )
  SET( mumpsintf_SRC mod_mumpsintf.f90 )
ELSE()
  SET( mumpsintf_SRC mod_mumpsintf_dummy.f90 )
ENDIF()

IF( UMFPACK_FOUND )
  SET( umfpackintf_SRC umf4_f77wrapper.c mod_umfpack.f90 )
ELSE()
  SET( umfpackintf_SRC mod_umfpack_dummy.f90 )
ENDIF()

# Source files for the library: should be more or less the same as the
# variable OBJ in the Makefile, taking into account which libraries
# have been detected and which not.
SET( fml_linsolver_SRC 
  mod_linsolver_base.f90
  mod_iterativesolvers_base.f90
  mod_gmres.f90
  mod_umfintf.f90
  ${pastixintf_SRC}
  ${mumpsintf_SRC}
  ${umfpackintf_SRC}
  mod_linsolver.f90
  mod_newton.f90 )

ADD_LIBRARY( fml_linear_solvers STATIC ${fml_linsolver_SRC} )

TARGET_LINK_LIBRARIES( fml_linear_solvers
  fml_general_utilities )

ADD_EXECUTABLE( test_fml_linear_solvers unit_test.F90 )

